<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>包装类型</title>
	<script>
		//		function someOne() {
		//			this.name = "Peter";
		//		}
		//
		//		someOne.prototype.name2 = "James";
		//
		//		someOne.prototype.printName = function () {
		//			console.log(this.name);
		//		};
		//
		//		var person1 = new someOne;
		//		person1.printName();

		//******hasOwnProperty()  : 看是不是对象自身下面的属性

		//		console.log(someOne.hasOwnProperty('name'));//true
		//		console.log(someOne.hasOwnProperty('name2'));//false

		//******  constructor :  查看对象的构造函数
		//******   每个原型都会自动添加constructor属性
		//******   For in 的时候有些属性是找不到的
		//******    避免修改construtor属性

		//		console.log(person1.constructor == someOne);//true
		//		console.log(person1.constructor == Object.prototype.constructor);//false
		//		console.log(Object.prototype.constructor);//function Object() { [native code] }


		//	function someOne() {}
		//
		//		someOne.prototype.name = "james";
		//		someOne.prototype.age = 11;
		//		//*** json 形式简写要加上constructor属性
		////		someOne.prototype = {
		////			constructor : someOne,
		////			name : "james",
		////			age : 22
		////		};
		//
		//		var p1 = new someOne;
		//		console.log(p1.constructor);
	</script>
</head>
<body>

</body>
</html>